#include "CurveView.h"

CurveView::CurveView(CurveModel& model) :
	model(model),
			window(sf::VideoMode(WINDOW_WIDTH, WINDOW_HEIGHT), WINDOW_TITLE) {
	// empty
}

CurveView::~CurveView() {
	// empty
}

void CurveView::draw() {
	window.Display();
}

void CurveView::close() {
	window.Close();
}

bool CurveView::canGetEvent() {
	event = sf::Event();
	return window.GetEvent(event);
}

CurveModelEvent CurveView::getEvent() {
	if (event.Type == sf::Event::Closed) {
		return EVENT_WINDOW_CLOSED;
	}
	if (event.Type == sf::Event::KeyPressed) {
		if (event.Key.Code == sf::Key::Escape) {
			return EVENT_KEY_ESCAPE;
		}
	}
	return EVENT_DUNNO;
}
